// 1619. 删除某些元素后的数组均值


#include <vector>
#include <algorithm>
using namespace std;

class Solution 
{
public:
    double trimMean(vector<int>& arr) 
    {
        // 1. 先排序
        sort(arr.begin(), arr.end());
        // 2. 遍历累加
        int n = arr.size();
        int range = n * 0.05;
        double sum = 0;
        for(int i = range; i < n - range; i++)
        {
            sum += arr[i];
        }
        return sum / (n - 2 * range);
    }
};